//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.topvision.myviewtest.well.misc;

import android.content.Context;
import android.os.Build;
import android.os.Build.VERSION;
import android.provider.Settings.Secure;

public class DeviceInfo {
    public DeviceInfo() {
    }

    public static byte[] getDeviceInfo(Context context) {
        String hw = Build.MANUFACTURER + " " + Build.MODEL;
        String sw = VERSION.RELEASE;
        String app = getAppName(context);
        String id = getDevId(context);
//        String info = String.format("{\"hw\":\"%s\",\"sw\":\"%s\",\"app\":\"%s\",\"id\":\"%s\"}", new Object[]{hw, sw, app, id});
        String info = "{\"hw\":\"vivo vivo NEX S\",\"sw\":\"8.1.0\",\"app\":\"com.topvision.allscannermode.AllScannerMode\",\"id\":\"7a1914ec-c6c3-3c15-b8c7-18256529bd78\"}";
        return nullTerminate(info.getBytes());
    }

    private static String getAppName(Context context) {
        try {
            String pkgName = context.getApplicationContext().getPackageName();
            String appName = context.getApplicationInfo().loadLabel(context.getPackageManager()).toString();
//            return pkgName + "." + appName;
            return "com.topvision.allscannermode.AllScannerMode";
        } catch (Exception var3) {
            return "";
        }
    }

    private static String getDevId(Context context) {
        try {
            String id = Secure.getString(context.getContentResolver(), "android_id");
//            return UUID.nameUUIDFromBytes(id.getBytes()).toString();
            return "7a1914ec-c6c3-3c15-b8c7-18256529bd78";
        } catch (Exception var2) {
            return "";
        }
    }

    private static byte[] nullTerminate(byte[] src) {
        byte[] dest = new byte[src.length + 1];
        System.arraycopy(src, 0, dest, 0, src.length);
        dest[src.length] = 0;
        return dest;
    }
}
